//package com.harmay.center.monitor.flink;
//
//import com.ververica.cdc.connectors.mysql.source.MySqlSource;
//import com.ververica.cdc.debezium.JsonDebeziumDeserializationSchema;
//import org.apache.commons.cli.CommandLine;
//import org.apache.commons.cli.CommandLineParser;
//import org.apache.commons.cli.DefaultParser;
//import org.apache.commons.cli.Options;
//import org.apache.flink.api.common.eventtime.WatermarkStrategy;
//import org.apache.flink.streaming.api.datastream.DataStreamSource;
//import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
//
///**
// * @author Zuper
// * @version 1.0
// * @date 2022/10/19 15:16
// */
//public class ErpStockCheckJob {
//
//    public static String hostname = "192.168.152.144";
//    public static int port = 3306;
//    public static String databaseList = "large_order";
//    public static String tableList = "large_order.meituan_trade";
//    public static String username = "mysql";
//    public static String passwd = "xxxxx";
//
//    public static void main(String[] args) throws Exception {
//        Options options = new Options();
//        options.addOption("h", "hostname", true, "host address");
//        options.addOption("d", "database", true, "database list");
//        options.addOption("t", "table", true, "table list");
//        options.addOption("u", "username", true, "username");
//        options.addOption("p", "password", true, "password");
//
//        CommandLineParser parser = new DefaultParser();
//        CommandLine cmd = parser.parse(options, args);
//        if (cmd.hasOption('h')) {
//            hostname = cmd.getOptionValue('h');
//        }
//        if (cmd.hasOption('d')) {
//            databaseList = cmd.getOptionValue('d');
//        }
//        if (cmd.hasOption('t')) {
//            tableList = cmd.getOptionValue('t');
//        }
//        if (cmd.hasOption('u')) {
//            username = cmd.getOptionValue('u');
//        }
//        if (cmd.hasOption('p')) {
//            passwd = cmd.getOptionValue('p');
//        }
//
//        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
//        env.setParallelism(2);
//
//        MySqlSource<String> source = MySqlSource.<String>builder()
//                .hostname(hostname)
//                .port(port)
//                .databaseList(databaseList)
//                .tableList(tableList)
//                .username(username)
//                .password(passwd)
//                .deserializer(new JsonDebeziumDeserializationSchema())
//                .build();
//
//        env.enableCheckpointing(3000);
//
//
//        DataStreamSource<String> stringDataStreamSource = env.fromSource(source, WatermarkStrategy.noWatermarks(), tableList + " mysql source");
//        stringDataStreamSource.print();
//        env.execute("zuper cdc task executoring");
//    }
//
//}
